<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
  import {MessageBox} from 'mint-ui';

  export default {
    name: 'app',
    methods: {
      handleNetworkError(element, type, handler) {
        if (element.addEventListener) {
          element.addEventListener(type, handler, false)
        } else if (element.attachEvent) {
          element.attachEvent('on' + type, handler)
        } else {
          element['on' + type] = handler
        }
      }
    },
    created() {
//      this.handleNetworkError(window, 'offline', function () {
//        MessageBox.alert('当前网络未连接，请检查网络', '提示')
//      })
//      console.log(this.$ajax)
    }
  }
</script>

<style lang="scss">
  @import "assets/css/config";

  body {
    background: #fff;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;

    #app {
      font-family: 'Avenir', Helvetica, Arial, sans-serif;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      color: #2c3e50;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      width: 100%;
      height: 100%;
      position: fixed;
      overflow-y: scroll;
      overflow-x: hidden;
      -webkit-overflow-scrolling: touch;
      background-color: #f4f4f4;
    }

    // MessageBox样式修改
    .mint-msgbox {
      border-radius: 10px;
      /*max-width: 85%;
      width: initial;
      min-width: 50%;*/
      width: r(270);
      .mint-msgbox-message {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        /*@extend .ellipsis;*/
      }
      .mint-msgbox-content {
        border: none;
      }
      .mint-msgbox-cancel {
        border: none;
      }

      .mint-msgbox-btns {
        height: inherit;
      }
      .button-style {
        background-color: #FFA506;
        color: #404040;
        width: r(50);
        height: r(40);
        border-radius: r(5);
      }

      .button-cancel-style {
        margin: 0 0 r(15) r(10);
      }

      .button-confirm-style {
        margin: 0 r(10) r(15) 0;
      }
    }

    //indicator样式修改
    .mint-indicator-spin {
      display: block;
    }
  }
</style>
